package com.ssy.lingxi.purchase.api.enums.tender;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 投标内部操作枚举类型
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/29
 */
public enum SubmitTenderInOperationEnum {

    Submit_Tender_Register(1, "招标报名"),
    Submit_Qualifications(2, "提交资格预审"),
    Add_Submit_Tender(3, "新增投标"),
    Submit_Check_Tender(4, "提交审核投标"),
    Check_Submit_Tender(5, "审核投标"),
    Submit_Submit_Tender(6, "提交投标");

    private Integer code;
    private String message;

    SubmitTenderInOperationEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code){
        SubmitTenderInOperationEnum statusEnum = Arrays.stream(SubmitTenderInOperationEnum.values()).filter(v -> v.getCode().equals(code)).findAny().orElse(null);
        return null == statusEnum ? "" : LanguageHolder.getName(SubmitTenderInOperationEnum.class, statusEnum.getCode());
    }
}
